Home > C Programming > If statements > Questions and Answers
01. |
What is the output of following C code? main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); } | |||||||||||
|
02. |
What is the output of following C code? main() { static int var = 5; printf("%d ",var--); if(var) main(); } | |||||||||||||||
|
03. |
What is the output of following C code? main() { int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); } | |||||||||||
|
04. |
What is the output of following C code? #ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); } | |||||||||||
|
05. | Which of the following is the boolean operator for logical-and? | |||||||||||
|
06. | Evaluate !(1 && !(0 || 1)). | |||||||||||
|
07. | Which of the following shows the correct syntax for an if statement? | |||||||||||
|
08. | The statement that tests to see if sum is equal to 10 and total is less than 20, and if so, prints the text string "incorrect.", is | |||||||||||
|
09. | If flag is 1 or letter is not an 'X', then assign the value 0 to exit_flag, else set exit_flag to 1. | |||||||||||
|
10. | The statement that compares the value of an integer called sum against the value 65, and if it is less, prints the text string "Sorry, try again", is | |||||||||||
|